<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue.js</title>
    <link rel="stylesheet" href="index.css">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        {{message}}
    </div>

    <div id="app2" v-bind:title="message">
        鼠标悬停此处几秒查看提示信息！
    </div>

    <p>控制切换一个元素是否显示</p>

    <div id="app3">
        <p v-if="seen">现在你看到我了</p>
    </div>

    <div id="app4">
        <ol>
            <li v-for="(todo, index) in todos" :key="index">{{todo.text}}</li>
        </ol>
    </div>

    <div id="app5">
        <p>{{message}}</p>
        <button v-on:click="reverseMessage">逆转消息</button>
    </div>

    <div id="app6">
        <p>{{message}}</p>
        <input type="text" v-model="message">
    </div>


    <h2>组件化应用构建</h2>
    <p>组件系统是Vue的另一个重要概念，因为它是一种抽象，允许我们使用小型、独立和通常可复用的组件构建大型应用。</p>


    <div id="app7">
        <ol>
            <!-- 创建一个 todo-item 组件的实例 -->
            <todo-item v-for="item in groceryList" v-bind:todo="item" v-bind:key="item.id"></todo-item>

        </ol>
        
    </div>











    
    <script src="index.js"></script>
</body>
</html>